{% extends 'blogmanage/layoutA.html' %}

{% block blog_header %}
    <section class="all_page_slider_bg">
        <div class="container">
            <div class="row">
                <div class="col-xs-12 ">
                    <div class="normal_service_text all_page_slider_text">
                        <h2>博客</h2>
                        <ol class="breadcrumb">
                            <li><a href="{{ url_for('blog.blog_index') }}">首页</a><span></span></li>
                            <li class="active"><a href="#">编辑博客</a></li>
                        </ol>
                    </div>
                </div><!-- column End -->
            </div><!-- row End -->
        </div><!-- container End -->
    </section>
{% endblock %}

{% block main_content %}
    <div class="row">
        <div class="col-md-8">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4>详细信息</h4>
                </div>
                <div class="panel-body">
                    <form action="#" method="post" class="form-horizontal" enctype="multipart/form-data">
                        {{ form.csrf_token }}
                        <div class="form-group">
                            {{ form.title.label(class="col-md-2 control-label") }}
                            <div class="col-sm-8 col-md-5">
                                {{ form.title(class="form-control ") }}
                            </div>
                        </div>
                        <div class="form-group">
                            {{ form.categoryid.label(class="col-md-2 control-label") }}
                            <div class="col-sm-8 col-md-3">
                                {{ form.categoryid(class="form-control ") }}
                            </div>
                        </div>
                        <div class="form-group">
                            {{ form.author.label(class="col-md-2 control-label") }}
                            <div class="col-sm-8 col-md-3">
                                {{ form.author(class="form-control ") }}
                            </div>
                        </div>
                        <div class="form-group">
                            {{ form.preface.label(class="col-md-2 control-label") }}
                            <div class="col-sm-8 col-md-3">
                                {{ form.preface(class="form-control ") }}
                            </div>
                        </div>
                        <div class="form-group">
                            {{ form.faceimage.label(class="col-md-2 control-label") }}
                            <div class="col-sm-8 col-md-3">
                                {{ form.faceimage }}
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="retime" class="col-md-2 control-label">已有图片</label>
                            <div class="col-md-5">
                                <img src="{{ url_for('.img', filename=art.faceimage if art.faceimage else '') }}"
                                     alt="已有图片" height="80px" width="80px">
                            </div>
                        </div>
                        <div class="form-group">
                            {{ form.body.label(class="col-md-2 control-label") }}
                            <div class="col-sm-8 col-md-10">
                                {{ form.body(id="ueditor") }}
                                {#                                <textarea name="ueditor" id="ueditor" cols="30" rows="10"></textarea>#}
                            </div>
                        </div>
                        <div class="form-group">
                            {{ form.isshow.label(class="col-md-2 control-label") }}
                            <div class="col-md-2">
                                {{ form.isshow }}
                            </div>
                        </div>
                        <div class="form-group">
                            {{ form.ispush.label(class="col-md-2 control-label") }}
                            <div class="col-md-2">
                                {{ form.ispush }}
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="retime" class="col-md-2 control-label">提交时间</label>
                            <div class="col-md-5">
                                {{ art.releasetime }}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 col-sm-2 control-label"></label>
                            <div class="col-lg-10">
                                <button type="submit" class="btn btn-success">提交编辑</button>
                                <button type="reset" class="btn btn-warning" disabled="disabled">重置</button>
                            </div>
                        </div>
                    </form>
                </div>

            </div>
        </div>
    </div>
{% endblock %}

{% block scripts %}
    <script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="/ueditor/ueditor.all.js"></script>
    <!-- 实例化编辑器 -->
    <script type="text/javascript">
        var ue = UE.getEditor('ueditor', {
            serverUrl: "/upload/"
        });
    </script>

{% endblock %}